package com.华为OD;

import java.util.Scanner;

public class t4是不是子序列 {
    private static String s,t;
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        s = in.nextLine();
        t = in.nextLine();
        System.out.println(isSon(s.length()-1,t.length()-1));
    }

    /**
     * 0-i,0-j
     */
    private static boolean isSon(int i,int j){
        if(i<0)
            return true;
        if(j<0)
            return false;
        if(s.charAt(i)==t.charAt(j)){
            return isSon(i-1,j-1);
        }
        return isSon(i,j-1);
    }
}
